package com.turman.networkdemo

/**
 * 网络请求统一封装
 */
interface HttpApi {

    /**
     * 异步get请求
     */
    fun get(params:Map<String,Any>,path:String, callback:IHttpCallback)


    /**
     * 同步get请求
     */
    fun getSync(params:Map<String,Any>,path:String):Any?

    /**
     * 异步post请求
     */
    fun post(body:Any,path:String, callback: IHttpCallback)

    /**
     * 同步post请求
     */
    fun postSync(body: Any,path: String):Any?

    /**
     * 取消指定请求
     */
    fun cancelRequest(tag:Any)

    /**
     * 取消全部请求
     */
    fun cancelAllRequest()
}